const gameCode = {
    index: true,
    border: true,
    stripe: true,
    menuAlign: 'center',
    selection: true,
    editBtn: false,
    addBtn: false,
    delBtn: false,
    loadingText: "加载中...",
    loadingSpinner: "svg",
    loadingSvgViewBox: "-10, -10, 50, 50",
    loadingBackground: "rgba(122, 122, 122, 0.6)",
    labelWidth: 60,
    column: [
        {
            label: "兑换码",
            prop: "code",
            span: 12,
            search: true,
            searchLabelWidth: 120,
            rules: [
                {
                    required: true,
                    message: "请输入游戏公司名称",
                    trigger: "blur"
                }
            ]
        },
        {
            label: "次数",
            prop: "cont",
            span: 12,
            search: false,
            searchLabelWidth: 120,
            rules: [
                {
                    required: true,
                    message: "请输入游戏公司名称",
                    trigger: "blur"
                }
            ],
            formatter: (row) => {
              return `${row.cont[0]}/${row.cont[1]}`
            }
        },
        {
            label: "创建时间",
            prop: "createAt",
            span: 12,
            search: false,
            overHidden: true,
            formatter: (row) => {
                const date = new Date(row.createAt*1000);
                return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
            }
        },

        {
            label: "使用时间",
            prop: "UseAt",
            span: 12,
            search: false,
            overHidden: true,
            rules: [
                {
                    required: true,
                    message: "请输入apiKey",
                    trigger: "blur"
                }
            ],
            formatter: (row) => {
                if(row.UseAt){
                    const date = new Date(row.UseAt*1000);
                    return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
                }else{
                    return '-'
                }
              
            }
        },

        {
            label: "失效日期",
            prop: "invalidAt",
            span: 12,
            search: false,
            overHidden: true,
            rules: [
                {
                    required: true,
                    message: "请输入apiSecret",
                    trigger: "blur"
                }
            ],
            formatter: (row) => {
                if(row.invalidAt){
                    const date = new Date(row.invalidAt * 1000);
                    return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
                }else{
                    return '-'
                }
              
            }
        },

        {
            label: "使用状态",
            prop: "status",
            span: 12,
            search: true,
            overHidden: true,
            rules: [
                {
                    required: true,
                    message: "请输入lobbyUrl",
                    trigger: "blur"
                }
            ],
            searchType: "select",
            dicData: [
                {
                    label: '未使用',
                    value: 0
                },
                {
                    label: '已使用',
                    value: 1
                },
                {
                    label: '已失效',
                    value: 2
                },
            ],
        },
        {
            label: '使用者ID',
            prop: 'useId',
            search: true,
            hide: true,
            rules: [
                {
                    required: true,
                    message: "请上传游戏公司封面",
                    trigger: "change"
                }
            ]
        },
        {
            label: '金额',
            prop: 'point',
            span: 12,
            rules: [
                {
                    required: true,
                    message: "请上传游戏公司封面",
                    trigger: "change"
                }
            ]
        },
    ],
}

export default gameCode